package com.atguigu.tingshu.album.client;

import com.atguigu.tingshu.album.client.impl.TrackInfoDegradeFeignClient;
import com.atguigu.tingshu.model.album.TrackInfo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

/**
 * <p>
 * 产品列表API接口
 * </p>
 *
 * @author qy
 */
@FeignClient(value = "service-album",
        fallback = TrackInfoDegradeFeignClient.class,
        contextId = "trackInfoFeignClient"
)
public interface TrackInfoFeignClient {
    /**
     * 根据id查询声音信息
     * @param trackId 声音id
     * @return 声音信息
     */
    @GetMapping("/client/album/trackInfo/getTrackInfo/{id}")
    TrackInfo getTrackInfo(@PathVariable("id") Long trackId);

    /**
     * 根据专辑id查询声音信息
     * @param albumId 专辑id
     * @param orderNum 声音排序
     * @param trackCount 声音数量
     * @return 声音信息集合
     */
    @GetMapping("/client/album/trackInfo/getTrackInfoList/{albumId}/{orderNum}/{trackCount}")
    List<TrackInfo> getTrackInfoList(@PathVariable("albumId") Long albumId,
                                     @PathVariable("orderNum")Integer orderNum,
                                     @PathVariable("trackCount")Integer trackCount);
}